package top.frsf.system.service.impl;

import java.util.List;
import top.frsf.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.frsf.system.mapper.TbEquipmentMaintenanceMapper;
import top.frsf.system.domain.TbEquipmentMaintenance;
import top.frsf.system.service.ITbEquipmentMaintenanceService;

/**
 * 设备类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-12
 */
@Service
public class TbEquipmentMaintenanceServiceImpl implements ITbEquipmentMaintenanceService 
{
    @Autowired
    private TbEquipmentMaintenanceMapper tbEquipmentMaintenanceMapper;

    /**
     * 查询设备类型
     * 
     * @param id 设备类型主键
     * @return 设备类型
     */
    @Override
    public TbEquipmentMaintenance selectTbEquipmentMaintenanceById(Long id)
    {
        return tbEquipmentMaintenanceMapper.selectTbEquipmentMaintenanceById(id);
    }

    /**
     * 查询设备类型列表
     * 
     * @param tbEquipmentMaintenance 设备类型
     * @return 设备类型
     */
    @Override
    public List<TbEquipmentMaintenance> selectTbEquipmentMaintenanceList(TbEquipmentMaintenance tbEquipmentMaintenance)
    {
        return tbEquipmentMaintenanceMapper.selectTbEquipmentMaintenanceList(tbEquipmentMaintenance);
    }

    /**
     * 新增设备类型
     * 
     * @param tbEquipmentMaintenance 设备类型
     * @return 结果
     */
    @Override
    public int insertTbEquipmentMaintenance(TbEquipmentMaintenance tbEquipmentMaintenance)
    {
        tbEquipmentMaintenance.setCreateTime(DateUtils.getNowDate());
        return tbEquipmentMaintenanceMapper.insertTbEquipmentMaintenance(tbEquipmentMaintenance);
    }

    /**
     * 修改设备类型
     * 
     * @param tbEquipmentMaintenance 设备类型
     * @return 结果
     */
    @Override
    public int updateTbEquipmentMaintenance(TbEquipmentMaintenance tbEquipmentMaintenance)
    {
        tbEquipmentMaintenance.setUpdateTime(DateUtils.getNowDate());
        return tbEquipmentMaintenanceMapper.updateTbEquipmentMaintenance(tbEquipmentMaintenance);
    }

    /**
     * 批量删除设备类型
     * 
     * @param ids 需要删除的设备类型主键
     * @return 结果
     */
    @Override
    public int deleteTbEquipmentMaintenanceByIds(Long[] ids)
    {
        return tbEquipmentMaintenanceMapper.deleteTbEquipmentMaintenanceByIds(ids);
    }

    /**
     * 删除设备类型信息
     * 
     * @param id 设备类型主键
     * @return 结果
     */
    @Override
    public int deleteTbEquipmentMaintenanceById(Long id)
    {
        return tbEquipmentMaintenanceMapper.deleteTbEquipmentMaintenanceById(id);
    }
}
